Imports System.Xml.Serialization

Public Class ReferentialConstraintRoleElement
    Inherits XEntityModelElementWithDocumentationBase

    ''' <summary>Initializes an instance of the <see cref="ReferentialConstraintRoleElement" /> class.</summary>
    ''' <param name="localName">The local name of the new element.</param>
    ''' <param name="namespaceName">The name of the namespace of the new element.</param>
    Public Sub New(ByVal localName As String, ByVal namespaceName As String)
        MyBase.New(localName, namespaceName)
        ValidateLocalName(localName, New String() {"Principal", "Dependent"})
    End Sub

    ''' <summary>Initializes an instance of the <see cref="ReferentialConstraintRoleElement" /> class.</summary>
    ''' <param name="other">An <see cref="System.Xml.Linq.XElement"/> object to copy from.</param>
    Public Sub New(ByVal other As XElement)
        MyBase.New(other)
    End Sub

    Private __propertyRef As PropertyRefCollection

    <AutoLoad()> _
    <XmlElement("PropertyRef", GetType(PropertyRef))> _
    Public ReadOnly Property PropertyReferences() As PropertyRefCollection
        Get
            If (__propertyRef Is Nothing) Then
                __propertyRef = New EdmxEditor.PropertyRefCollection(Me, MyBase.Name.Namespace, "PropertyRef")
            End If
            Return __propertyRef
        End Get
    End Property

    <XmlAttribute()> _
    Public Property Role() As String
        Get
            Return Me.@Role
        End Get
        Set(ByVal value As String)
            Me.@Role = value
        End Set
    End Property

End Class
